package org.com.thang.user;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.com.system.util.model.Model;
import org.com.thang.dept.Dept;
import org.hibernate.annotations.GenericGenerator;


@Entity
@Table(name="t_user_info",catalog="thang")
public class TUser extends Model{

	private String id;
	private String userName;
	private String userPass;
	private String loginName;
	private String birth;
	private String opt;
	
	private Dept dept;
	
	
	public TUser(){}

	public TUser(String userName, String userPass, String loginName,String birth, String opt) {
		//this.id = id;
		this.userName = userName;
		this.userPass = userPass;
		this.loginName = loginName;
		this.birth = birth;
		this.opt = opt;
	}

	@Id
	@GenericGenerator(name="gener",strategy="uuid2")
	@GeneratedValue(generator="gener")
	@Column(name="id",unique=true,nullable=true)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name="user_name",length=45)
	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	@Column(name="user_pass",length=45)
	public String getUserPass() {
		return userPass;
	}

	public void setUserPass(String userPass) {
		this.userPass = userPass;
	}

	@Column(name="login_name",length=45)
	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	@Column(name="birth",length=45)
	public String getBirth() {
		return birth;
	}

	public void setBirth(String birth) {
		this.birth = birth;
	}

	@Column(name="opt",length=245)
	public String getOpt() {
		return opt;
	}

	public void setOpt(String opt) {
		this.opt = opt;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name = "dept_id")
	public Dept getDept() {
		return dept;
	}

	public void setDept(Dept dept) {
		this.dept = dept;
	}
	
}
